package cmm.Lexer;

/**
 * Created by zhangzheyu on 2017/10/10.
 */
public class Token {
    private TokenType type;
    private  String value;
    private int lineNum;
    private int position;
    public Token(TokenType type, String value, int lineNum){
        this.type = type;
        this.value =value;
        this.lineNum = lineNum;
    }
    public Token(TokenType type, String value, int lineNum,int position){
        this.type = type;
        this.value =value;
        this.lineNum = lineNum;
        this.position =position;
    }
    public Token(){}
    public TokenType getType(){
        return type;
    }
    public String getValue(){
        return value;
    }
    public int getLineNum(){
        return lineNum;
    }
    public String toString(){
        return  value;
    }
    public int getPosition(){return position;}
    public void setPosition(int position){this.position = position;}
}
